package com.lottery.dao.pc28.wealthDao;

import com.lottery.entity.AccountTransaction;
import com.lottery.entity.Rebate;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 账户流水表Dao;
 */
public interface AccountTransactionDao {
	/**
	 * 查询所有
	 */
	List<AccountTransaction> selectAccountTransactionList();

	/**
	 * 根据主键ID查询
	 */
	AccountTransaction selectAccountTransactionById(@Param(value = "id") int id);

	/**
	 * 根据账户id查询
	 */
	List<AccountTransaction> selectAccountTransactionByAccountId(@Param(value = "accountId") int accountId);

	/**
	 * 根据状态查询
	 */
	List<AccountTransaction> selectAccountTransactionBystate(@Param(value = "state") int state);

	/**
	 * 添加
	 */
	void insertAccountTransaction(AccountTransaction accounttransaction);

	/**
	 * 修改
	 */
	void updateAccountTransaction(AccountTransaction accounttransaction);

	/**
	 * 根据订单号来查询用户信息
	 */
	AccountTransaction selectByorderId(String orderId);

	int selectTransactionCountById(int accountId);

	/**
	 * 分页查询
	 * 
	 * @param pageNow
	 * @param pageSize
	 * @return
	 */
	List<AccountTransaction> selectAccountTransactionByAccountIdLimit(@Param(value = "accountId") int accountId,
                                                                      @Param(value = "types") int types, @Param(value = "startPage") int startPage,
                                                                      @Param(value = "pageSize") int pageSize);

	/**
	 * 根据userid查询分成金额
	 */
	String selectTransactionMoney(int userId);

	/**
	 * 查询提现流水状态接口
	 */
	List<AccountTransaction> queryOrderStatus(Map<String, Integer> params);

	/**
	 * 返点操作
	 */
	List<Rebate> queryRebate(int startCount);

	int getCashTimes(int accountId);

	int totalWithDrawWealth(Map<String, Object> params);

	int totalRechargeWealth(Map<String, Object> params);

	int selectSumAmount(Map<String, Object> params);

	int selectSumAmountWithDrow(Map<String, Object> params);

	List<AccountTransaction> selectTranstionList(Map<String, Object> params);
}
